<template>
  <div class="Allpadding Toppadding padding">
      <my-head title="今日上新"></my-head>
      <div class="today">
        {{timer.dayNO}} {{timer.weekDay}}
      </div>
      <div class="new" v-for="(item,index) in news" :key="index">
        <router-link :to="{name:'shoubandetailed',query:item}">
        <div class="new_img">
          <img :src="item.img" alt="">
        </div>
        <div class="new_main">
          <p class="new_tit van-multi-ellipsis--l2"><span v-if="item.preSaleTagName">{{item.preSaleTagName}}</span>{{item.name}}</p>
          <p class="new_cont van-ellipsis">{{item.brief}}</p>
          <p class="new_type"></p>
          <p class="new_price">{{item.priceSymbol}} {{item.priceDesc[0]}}{{item.pricePrefix}}</p>
        </div>
        </router-link>
      </div>
  </div>
</template>

<script>
export default {
data() {
  return {
    news:null,
    timer:null,
  }
},
methods: {
  async getNew(){
    let res=await this.$ajax.getNew({
    pageNum: 1,
    pageSize: 20,
    version: 1.0,
    cityId: 0,
    })
    console.log(res);
    this.timer=res.data.vo.days[0]
    this.news=res.data.vo.days[0].presaleItems
  console.log(this.timer);
  }
},
mounted() {
  this.getNew()
},
}
</script>

<style>
.padding{
  padding-top:70px;
}
.today{
  position: fixed;
  z-index: 100;
  box-sizing: border-box;
  width: 100%;
  height: 24px;
  padding-left: 12px;
  background-color: #f4f4f4;
  font-size: 12px;
  color: #999;
  line-height: 24px;
  top:46px;
}
.new a{
  position: relative;
  display: flex;
  justify-content:start;
  width: 100%;
  height: 137px;
  background-color: #fff;
  margin-bottom: 10px;
  border-radius: 10px;
  box-shadow: 2px 2px 5px #c5c4c4;
  color: #333;
}
.new .new_img{
  width: 116px;
  height: 127px;
  margin-top: 10px;
}
.new_img img{
  height: 116px;
  width: 116px;
}
.new_main{
  width: 225px;
}
.new_main .new_tit{
      font-weight: 700;
    height: 36px;
    font-size: 14px;
    width: 100%;
    line-height: 18px;
    overflow: hidden;
     text-overflow: ellipsis;
     margin: 18px 0px  4px 10px;
     box-sizing: border-box;

}
.new_tit span{
  display: inline-block;
  background:#c5c4c4 ;
  font-size: 8px;
  border-radius: 3px;
  color: #333;
  height: 13px;
  line-height: 13px;
  width: 20px;
  text-align: center;
  margin-right:5px ;

}
  .new_main .new_cont{
    width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      height: 17px;
      margin-top: 4px;
      font-size: 12px;
      color: #999;
      line-height: 17px;
      margin-left: 10px;
}
.new_main .new_type{
  height: 16px;
  width: 100%;
}
.new_main .new_price{
  font-size: 18px;
  width: 100%;
  height: 18px;
  margin-top: 10px;
  color:#ff5687;
   margin-left: 10px;
}
</style>